<style scoped>
    .printSF{ margin:0px !important; padding:0px !important; font-family:"黑体", Arial !important; font-size:11px !important; line-height: 1 !important;color: black !important; }
    img {border:0px;}
    .wrapper{ width:600px; height:97%;  margin:0px auto; padding:0px;}
</style>
<template>
    <div class="printSF">
        <div align="center" class="noprint">
            <Button @click="print">打印</Button>
        </div>
        <div class="wrapper" id="sf">
            <img v-for="img  in  upsprintList" :src="img.imageString" height="400" width="700">
        </div>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                upsprintList:[]
            }
        },
        created: function () {
            $(".console-body").css({top:0});
            axios.get('shipping/'+this.$route.params.shippingId+'/print').then(res => {
                this.upsprintList = res.data.images;
            }).catch(err =>{
                this.$Message.error(err);
            })
        },

        mounted() {
            window.onresize = function(){
                $("#contcentHeight").css({height:(window.innerHeight - 174)+"px"});
                $("#rightWidth").css({width:(window.innerWidth - 180)+"px"});
            };
        },

        updated:function () {

        },
        methods: {
            print(){
                $("div.noprint").hide();
                window.print();
                $("div.noprint").show();
            }
        }

    }
</script>
